package me.hgj.jetpackmvvm.ledun.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import me.hgj.jetpackmvvm.ledun.R
import me.hgj.jetpackmvvm.ledun.data.model.bean.Mode
import me.hgj.jetpackmvvm.ledun.ui.view.RoundedImageView

class ModeAdapter(data: ArrayList<Mode>) :
    BaseQuickAdapter<Mode, BaseViewHolder>(R.layout.item_mode, data) {

    override fun convert(holder: BaseViewHolder, item: Mode) {
        item.run {
            holder.setText(R.id.item_mode_type, modeName)
            var image=holder.getView<RoundedImageView>(R.id.item_mode_image)
            image.setImageResource(imageId)
        }
    }
}